package com.zc.controller;

import com.zc.entities.CommonResult;
import com.zc.entities.Order;
import com.zc.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @author: cong
 * @create: 2024/11/4
 */
@RestController
@Slf4j
public class OrderController {
    @Resource
    private OrderService orderService;

    @PostMapping("/order/create")
    public CommonResult<Order> create(@RequestBody Order order)
    {
        orderService.create(order);
        return new CommonResult<>(200, "订单创建成功",order);
    }
}
